import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import 'font-awesome/css/font-awesome.min.css'
import VueScroll from 'vuescroll'
import 'vuescroll/dist/vuescroll.css'
import router from './router'
import store from './store'
import adminauth from '@/common/adminauth'
import '@/common/dialog'
import md5 from 'js-md5'
import './components'
import VueClipboard from 'vue-clipboard2'

Vue.config.productionTip = false
Vue.use(ElementUI)
Vue.use(VueScroll)
Vue.use(VueClipboard)

Vue.prototype.$md5 = md5
Vue.prototype.$clearCache = () => {
  // 清除localStorage缓存
  localStorage.clear()

  // 清除sessionStorage缓存
  sessionStorage.clear()
  // 清除cookies
  document.cookie.split(';').forEach(function (c) {
    document.cookie =
      c.trim().split('=').shift() +
      '=;expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/'
  })
}
Vue.prototype.msgSuccess = function (msg) {
  this.$message({ showClose: true, message: msg, type: 'success' })
}

Vue.prototype.msgError = function (msg) {
  this.$message({ showClose: true, message: msg, type: 'error' })
}

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app')
